﻿@inject BingWallpaperService BingWallpaperService
@inject HomePageService HomePageService
@{ 
    ViewBag.HomePage = HomePageService.Config;
}

<div>
    <script type="text/javascript" src="~/lib/typed.js/dist/typed.umd.min.js"></script>
    <link rel="stylesheet" href="~/css/home/index.min.css" />

    <div>
        <header class="fh5co-cover js-fullheight">

            @switch (ViewBag.Theme.BackgroundType)
            {
                case BackgroundType.Color:
                    <div id="colorbg"></div>
                    break;

                case BackgroundType.Bing:
                    <div id="imgbg" style="background-image:url('@await BingWallpaperService.GetUrl()');"></div>
                    break;

                case BackgroundType.Custom:
                    <div id="imgbg" style="background-image: url('@OssService.GetBackground()');"></div>
                    break;
            }

            <div class="container">
                <div class="row">
                    <div class="col-md-8 offset-md-2 text-center">
                        <div class="display-t js-fullheight">

                            <div class="display-tc">
                                <img id="avatar" src="@OssService.GetAvatar()" />
                                <h1><span id="name">@(ViewBag.Title == null ? ViewBag.Profile.Name : ViewBag.Title)</span></h1>
                                <h2><span id="info"></span></h2>
                                <input id="infoList" type="hidden" value="@ViewBag.Profile.Info"/>
                                <h3><span id="qq">QQ：@ViewBag.Profile.QQ</span></h3>
                                <br />
                                <h3><span id="email">Email：@ViewBag.Profile.Email</span></h3>
                                <br /><br />

                                <a onclick="scrollToProject()">
                                    <img id="btn_dowm" src="https://corehome.oss-accelerate.aliyuncs.com/images/down.png" />
                                </a>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </header>

        <div id="project" class="container">

            @if (ViewBag.HomePage.Count > 0)
            {
                <!--Title-->
                <div class="row reveal">
                    <div class="text-center fh5co-heading">
                        <h2 class="display-4">My Project</h2>
                    </div>
                </div>
            }

            <div class="row">
                @foreach (var project in ViewBag.HomePage)
                {
                    @await Component.InvokeAsync("Project", project)
                }
            </div>

        </div>

        <audio id="player" src="/Service/BackgroundMusic"></audio>

        <!-- Main -->
        <script src="~/js/home/index.min.js"></script>

    </div>

</div>